package com.feng.profile.vo;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author Lee
 */
public class UserAddReq implements Serializable {

    @NotNull
    private String userName;

    @NotNull
    private String password;

    @Email
    private String email;

    @Length(min = 11)
    private String mobile;

    private String createUserId;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof UserAddReq)) return false;

        UserAddReq that = (UserAddReq) o;

        if (!userName.equals(that.userName)) return false;
        if (!password.equals(that.password)) return false;
        if (!email.equals(that.email)) return false;
        if (!mobile.equals(that.mobile)) return false;
        return createUserId.equals(that.createUserId);
    }

    @Override
    public int hashCode() {
        int result = userName.hashCode();
        result = 31 * result + password.hashCode();
        result = 31 * result + email.hashCode();
        result = 31 * result + mobile.hashCode();
        result = 31 * result + createUserId.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "UserAddReq{" +
                "userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", mobile='" + mobile + '\'' +
                ", createUserId='" + createUserId + '\'' +
                '}';
    }
}
